﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;

namespace _14.ReplaceATagWithUrlTag
{
    class ReplaceATagWithUrlTag
    {
        static void Main(string[] args)
        {
            string text = "<p>Please visit <a href=\"http://academy.telerik. com\">our site</a> to choose a training course. Also visit <a href=\"www.devbg.org\">our forum</a> to discuss the courses.</p>";
            Console.WriteLine(text);
            string pattern = "(<a href=)(*?)(>)";
            string replaced = Regex.Replace(text, "(<a href=\")(.*?)(\">)","[URL=$2]");
            replaced = replaced.Replace("</a>", "[/URL]");
            Console.WriteLine(replaced);

        }
    }
}
